package jf.collections;

import java.util.Collection;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;

/**
 * @author alex
 * @date 17.05.2009
 */
public class LinkedListX<A> extends AbstractListX<A> {
	private LinkedList<A> list;

	public LinkedListX() {
		list = new LinkedList<A>();
	}

	public LinkedListX(Collection<? extends A> lst) {
		list = new LinkedList<A>(lst);
	}


	protected List<A> getBaseCollection() {
		return list;
	}

	public <B> ListX<B> createNewList(int capacity) {
		return new LinkedListX<B>();
	}

	public <B> ListX<B> createNewList() {
		return new LinkedListX<B>();
	}

	public <B> ListX<B> createNewList(Collection<? extends B> inital) {
		return new LinkedListX<B>(inital);
	}

	public Iterator<A> rightIterator() {
		return list.descendingIterator();
	}
}
